import sun.audio.AudioStream;

/*
显示图片
    1.创建图片对象，从源文件拿到图片数据
        Image myImag = Toolkit.getDefaultToolkit().getImage("bg.jpg");
    2.重写窗口的paint函数，画出图形；
        public void paint(Graphics g){
            g.drawImage(myImag,0,0,this);
        }
 */
import javax.swing.*;
import java.applet.Applet;
import java.applet.AppletStub;
import java.applet.AudioClip;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.FilteredImageSource;
import java.math.BigDecimal;
import java.net.URL;


public class Project{
    public static void main(String[] args){
        Example7_5 eg = new Example7_5();
        eg.start();
    }
}

class Example7_5 extends JFrame {
    Image myImag;

    public void start(){
        myImag = Toolkit.getDefaultToolkit().getImage("bg.jpg");
        setSize(800,600);
        setVisible(true);

    }

    public void paint(Graphics g){
        g.drawImage(myImag,0,0,this);
    }
}

